Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use protobuf encoding for core K8s apis #676

Merged
merged 1 commit into from
Sep 20, 2024

Conversation

Nikhil-Ladha
Copy link
Contributor

For core K8s API objects like Pods, Nodes, etc., we can use protobuf encoding which reduces CPU consumption related to (de)serialization, reduces overall latency of the API call, reduces memory footprint, reduces the amount of work performed by the GC and results in quicker propagation of objects to event handlers of shared informers.

@black-dragon74
Copy link
Member

From: https://kubernetes.io/docs/reference/using-api/api-concepts/#alternate-representations-of-resources:

Not all API resource types support Protobuf; specifically, Protobuf isn't available for resources that are defined as CustomResourceDefinitions or are served via the aggregation layer.

Does it work for CRDs that we have?

@Nikhil-Ladha
Copy link
Contributor Author

From: https://kubernetes.io/docs/reference/using-api/api-concepts/#alternate-representations-of-resources:

Not all API resource types support Protobuf; specifically, Protobuf isn't available for resources that are defined as CustomResourceDefinitions or are served via the aggregation layer.

Does it work for CRDs that we have?

Right, it doesn't work for CRDs.
We can't use it for the csi-addons controller code, will have to update and check the pod deployment once.

For core K8s API objects like Pods, Nodes, etc., we
can use protobuf encoding which reduces CPU consumption
related to (de)serialization, reduces overall latency
of the API call, reduces memory footprint, reduces the
amount of work performed by the GC and results in quicker
propagation of objects to event handlers of shared informers.

Signed-off-by: Nikhil-Ladha <[email protected]>
@Nikhil-Ladha
Copy link
Contributor Author

Updated it to add the protobuf encoding only for CLI tool interactions after testing, in other places we have use the client to interact with CRDs.

@mergify mergify bot merged commit b2ef27f into csi-addons:main Sep 20, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants